#include "stdio.h"
extern int  _HEAP_START;
extern int  _HEAP_END;

extern void *_sbrk(int incr)
{
    static unsigned char *heap = NULL;
    unsigned char *prev_heap;

    if (heap == NULL) {
        heap = (unsigned char *)&_HEAP_START;
    }
    prev_heap = heap;

    if ((heap + incr) >= (unsigned char *)&_HEAP_END) {
        return 0;
    }
    heap += incr;
    return (void *)prev_heap;
}
